﻿Imports System.Data
Imports System.Data.SqlClient
Public Class Form9
    Sub Carga_Proveedores()
        Dim SQL As String = "select Cod_Proveedor, Razon_Social, Ruc, Habilitado FROM Licitacion_Proveedor WHERE Cod_Licitacion='" & Cod_Lic & "'" & " ORDER BY Cod_Proveedor ASC"
        Dim da As SqlDataAdapter
        Dim dt As New DataTable
        Try
            da = New SqlDataAdapter(SQL, nCnn)
            da.Fill(dt)
            ListView1.Items.Clear()
            For i = 0 To dt.Rows.Count - 1
                Dim Itm = ListView1.Items.Add(RTrim(dt.Rows(i)("Cod_Proveedor")))
                Itm.SubItems.Add(RTrim(dt.Rows(i)("Razon_Social")))
                Itm.SubItems.Add(RTrim(dt.Rows(i)("Ruc")))
                Itm.SubItems.Add(RTrim(dt.Rows(i)("Habilitado")))
            Next
            ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
        Catch ex As Exception
            MsgBox("Importando Proveedores: " & ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
    Private Sub Form9_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Call Carga_Proveedores()
    End Sub
End Class